Update TagListGenerator to always useReadOnlySpan<byte> properties#8486
Update TagListGenerator to always useReadOnlySpan<byte> properties#8486andrewlock merged 2 commits intomasterfrom
TagListGenerator to always useReadOnlySpan<byte> properties#8486Conversation
25f6d5e to
b1f8279
Compare
eca7df4 to
54730c9
Compare
BenchmarksBenchmark execution time: 2026-04-24 17:08:43 Comparing candidate commit 40b0f3c in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 27 metrics, 0 unstable metrics, 60 known flaky benchmarks, 27 flaky benchmarks without significant changes.
|
bouwkast
left a comment
There was a problem hiding this comment.
LGTM, I mainly looked at the Source.cs and the tests and then just did a look at some of the generated files, assuming the others are the same
b1f8279 to
9b090d5
Compare
14245b2 to
fa83d95
Compare
d54f3cf to
d1485d3
Compare
fa83d95 to
787ab49
Compare
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8486) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-time benchmarks measure the whole time it takes to execute a program, and are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are highlighted in **red**. The following thresholds were used for comparing the execution times:
Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard. Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph). Duration chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8486) - mean (75ms) : 71, 79
master - mean (75ms) : 71, 78
section Bailout
This PR (8486) - mean (78ms) : 74, 81
master - mean (77ms) : 74, 79
section CallTarget+Inlining+NGEN
This PR (8486) - mean (1,084ms) : 1032, 1137
master - mean (1,082ms) : 1034, 1130
FakeDbCommand (.NET Core 3.1)gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8486) - mean (116ms) : 109, 124
master - mean (116ms) : 110, 122
section Bailout
This PR (8486) - mean (115ms) : 111, 118
master - mean (116ms) : 113, 119
section CallTarget+Inlining+NGEN
This PR (8486) - mean (781ms) : 752, 809
master - mean (784ms) : 754, 813
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8486) - mean (104ms) : 96, 111
master - mean (101ms) : 99, 104
section Bailout
This PR (8486) - mean (102ms) : 99, 105
master - mean (102ms) : 100, 105
section CallTarget+Inlining+NGEN
This PR (8486) - mean (943ms) : 904, 982
master - mean (946ms) : 912, 979
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8486) - mean (102ms) : 96, 108
master - mean (104ms) : 97, 111
section Bailout
This PR (8486) - mean (105ms) : 100, 110
master - mean (102ms) : 98, 106
section CallTarget+Inlining+NGEN
This PR (8486) - mean (824ms) : 787, 862
master - mean (824ms) : 790, 857
HttpMessageHandler (.NET Framework 4.8)gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8486) - mean (202ms) : 196, 209
master - mean (205ms) : 194, 216
section Bailout
This PR (8486) - mean (206ms) : 200, 213
master - mean (208ms) : 201, 215
section CallTarget+Inlining+NGEN
This PR (8486) - mean (1,203ms) : 1143, 1262
master - mean (1,210ms) : 1159, 1261
HttpMessageHandler (.NET Core 3.1)gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8486) - mean (292ms) : 278, 306
master - mean (293ms) : 278, 309
section Bailout
This PR (8486) - mean (293ms) : 280, 305
master - mean (295ms) : 283, 306
section CallTarget+Inlining+NGEN
This PR (8486) - mean (963ms) : 933, 993
master - mean (965ms) : 934, 996
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8486) - mean (287ms) : 270, 304
master - mean (291ms) : 273, 308
section Bailout
This PR (8486) - mean (287ms) : 272, 301
master - mean (291ms) : 276, 306
section CallTarget+Inlining+NGEN
This PR (8486) - mean (1,162ms) : 1124, 1199
master - mean (1,166ms) : 1119, 1213
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8486) - mean (288ms) : 271, 305
master - mean (287ms) : 276, 298
section Bailout
This PR (8486) - mean (289ms) : 274, 304
master - mean (289ms) : 276, 302
section CallTarget+Inlining+NGEN
This PR (8486) - mean (1,046ms) : 989, 1103
master - mean (1,056ms) : 978, 1134
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
787ab49 to
40b0f3c
Compare
… string literals (#8487) ## Summary of changes Convert `Encoding.Utf8.GetBytes` calls to static constants using UTF8 string literals ## Reason for change After moving our vendored `Span<T>` implementation into the `System` namespace, various optimizations open up to us, including using UTF-8 string literals, to encode strings to UTF-8 at compile time instead of at runtime. By combing with `static ReadOnlySpan<byte>` properties, these also become zero allocation, so we get reduced overall memory usage as well as better startup time ## Implementation details Replace the following with utf8 string literals: - `StringEncoding.UTF8.GetBytes` - `Encoding.UTF8.GetBytes` - `EncodingHelpers.UTF8NoBom.GetBytes` ## Test coverage All covered by existing tests ## Other details Depends on a stack updating our vendored system code - #8391 - #8454 - #8455 - #8459 - #8461 - #8469 - #8476 - #8477 - #8486
Summary of changes
Update the tag list generator to always use
ReadOnlySpan<byte>properties instead ofbyte[]Reason for change
After moving our vendored
Span<T>implementation into theSystemnamespace, various optimizations open up to us, including usingReadOnlySpan<byte>properties on .NET Framework instead ofstatic readonly byte[]to avoid startup costs.Implementation details
Replace the code generated by the generator, and update the generated code
Test coverage
Covered by snapshot tests and behaviour is covered by existing tests. We'll check the benchmarks to make sure that we don't see any perf impact (there shouldn't be, impact should just be reduced startup costs)
Other details
Depends on a stack updating our vendored system code
ReadOnlySpan<T>,Span<T>et. al. to System namespace #8476Span<T>namespace changes #8477